<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
function splitStr(){
        var str = "101_5&201_10&301_20"
        var arr = str.split("&")
        console.log(arr)
        for(var i = 0;i<arr.length; i++){
            var goodsStr = arr[i];
            var goodsArr = goodsStr.split("_")
            console.log(goodsArr[0],goodsArr[1])
}
}
splitStr()
</script>
</head>
<body>
</body>
</html>